home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / signal.h,v < prev    next >
Encoding:
Text File  |  1991-10-25  |  7.7 KB  |  408 lines

  1. head     1.14;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.14
  10. date     91.10.24.17.49.43;  author rab;  state Exp;
  11. branches ;
  12. next     1.13;
  13.  
  14. 1.13
  15. date     91.10.24.17.34.16;  author rab;  state Exp;
  16. branches ;
  17. next     1.12;
  18.  
  19. 1.12
  20. date     91.09.05.21.54.04;  author shirriff;  state Exp;
  21. branches ;
  22. next     1.11;
  23.  
  24. 1.11
  25. date     91.05.30.13.22.03;  author shirriff;  state Exp;
  26. branches ;
  27. next     1.10;
  28.  
  29. 1.10
  30. date     90.12.18.18.39.43;  author kupfer;  state Exp;
  31. branches ;
  32. next     1.9;
  33.  
  34. 1.9
  35. date     90.09.10.16.14.22;  author kupfer;  state Exp;
  36. branches ;
  37. next     1.8;
  38.  
  39. 1.8
  40. date     89.06.15.12.53.40;  author ouster;  state Exp;
  41. branches ;
  42. next     1.7;
  43.  
  44. 1.7
  45. date     89.06.15.11.55.37;  author ouster;  state Exp;
  46. branches ;
  47. next     1.6;
  48.  
  49. 1.6
  50. date     89.03.06.15.15.28;  author rab;  state Exp;
  51. branches ;
  52. next     1.5;
  53.  
  54. 1.5
  55. date     88.10.20.15.26.13;  author ouster;  state Exp;
  56. branches ;
  57. next     1.4;
  58.  
  59. 1.4
  60. date     88.09.08.15.36.17;  author ouster;  state Exp;
  61. branches ;
  62. next     1.3;
  63.  
  64. 1.3
  65. date     88.06.29.14.57.54;  author ouster;  state Exp;
  66. branches ;
  67. next     1.2;
  68.  
  69. 1.2
  70. date     88.06.21.16.46.25;  author ouster;  state Exp;
  71. branches ;
  72. next     1.1;
  73.  
  74. 1.1
  75. date     88.06.21.16.42.09;  author ouster;  state Exp;
  76. branches ;
  77. next     ;
  78.  
  79.  
  80. desc
  81. @@
  82.  
  83.  
  84. 1.14
  85. log
  86. @Deleted my previous changes because it was the wrong way to fix the problem.
  87. @
  88. text
  89. @/*
  90.  * Copyright (c) 1982, 1986 Regents of the University of California.
  91.  * All rights reserved.  The Berkeley software License Agreement
  92.  * specifies the terms and conditions for redistribution.
  93.  *
  94.  *    @@(#)signal.h    7.3 (Berkeley) 5/14/88
  95.  * $Header: /sprite/src/lib/include/RCS/signal.h,v 1.13 91/10/24 17:34:16 rab Exp Locker: rab $
  96.  */
  97.  
  98. #ifndef _SIGNAL
  99. #define _SIGNAL
  100.  
  101. #include <cfuncproto.h>
  102. #include <machSignal.h>
  103.  
  104. #ifndef    NSIG
  105. #define NSIG    32
  106. #endif
  107.  
  108. #define    SIGHUP    1    /* hangup */
  109. #define    SIGINT    2    /* interrupt */
  110. #define    SIGQUIT    3    /* quit */
  111. #define    SIGILL    4    /* illegal instruction (not reset when caught) */
  112. #define    SIGTRAP    5    /* trace trap (not reset when caught) */
  113. #define    SIGIOT    6    /* IOT instruction */
  114. #define    SIGABRT    SIGIOT    /* compatibility */
  115. #define    SIGEMT    7    /* EMT instruction */
  116. #define    SIGFPE    8    /* floating point exception */
  117. #define    SIGKILL    9    /* kill (cannot be caught or ignored) */
  118. #define    SIGBUS    10    /* bus error */
  119. #define    SIGSEGV    11    /* segmentation violation */
  120. #define    SIGSYS    12    /* bad argument to system call */
  121. #define    SIGPIPE    13    /* write on a pipe with no one to read it */
  122. #define    SIGALRM    14    /* alarm clock */
  123. #define    SIGTERM    15    /* software termination signal from kill */
  124. #define    SIGURG    16    /* urgent condition on IO channel */
  125. #define    SIGSTOP    17    /* sendable stop signal not from tty */
  126. #define    SIGTSTP    18    /* stop signal from tty */
  127. #define    SIGCONT    19    /* continue a stopped process */
  128. #define    SIGCHLD    20    /* to parent on child stop or exit */
  129. #define    SIGCLD    SIGCHLD    /* compatibility */
  130. #define    SIGTTIN    21    /* to readers pgrp upon background tty read */
  131. #define    SIGTTOU    22    /* like TTIN for output if (tp->t_local<OSTOP) */
  132. #define    SIGIO    23    /* input/output possible signal */
  133. #define    SIGXCPU    24    /* exceeded CPU time limit */
  134. #define    SIGXFSZ    25    /* exceeded file size limit */
  135. #define    SIGVTALRM 26    /* virtual time alarm */
  136. #define    SIGPROF    27    /* profiling time alarm */
  137. #define SIGWINCH 28    /* window size changes */
  138. #define SIGUSR1 30    /* user defined signal 1 */
  139. #define SIGUSR2 31    /* user defined signal 2 */
  140.  
  141. /*
  142.  * Special Sprite signals:
  143.  */
  144.  
  145. #define SIGDEBUG 3    /* debug (same as quit in Sprite) */
  146. #define SIGMIG    10    /* migrate process */
  147. #define SIGMIGHOME 29    /* migrate process back to home node */
  148.  
  149. #ifndef KERNEL
  150. /* 
  151.  * This is taken more or less from K&R 2nd ed., section B9.  Recall 
  152.  * that signal() returns the previous handler.
  153.  */
  154. extern void (*signal _ARGS_((int sig,
  155.                  void (*handler)(int sig)))) _ARGS_((int sig));
  156.  
  157. extern int sigblock _ARGS_ ((int mask));
  158. extern int sigpause _ARGS_ ((int mask));
  159. extern int sigsetmask _ARGS_ ((int mask));
  160. #endif
  161.  
  162. /*
  163.  * Signal vector "template" used in sigvec call.
  164.  */
  165. struct    sigvec {
  166.     void    (*sv_handler)();    /* signal handler */
  167.     int    sv_mask;        /* signal mask to apply */
  168.     int    sv_flags;        /* see signal options below */
  169. };
  170. #define SV_ONSTACK    0x0001    /* take signal on signal stack */
  171. #define SV_INTERRUPT    0x0002    /* do not restart system on signal return */
  172. #define sv_onstack sv_flags    /* isn't compatibility wonderful! */
  173.  
  174. /*
  175.  * Structure used in sigstack call.
  176.  */
  177. struct    sigstack {
  178.     char    *ss_sp;            /* signal stack pointer */
  179.     int    ss_onstack;        /* current status */
  180. };
  181.  
  182. #if 0
  183. /*
  184.  * This declaration has been moved to the machine dependent file
  185.  * machSignal.h
  186.  */
  187.  
  188. /*
  189.  * Information pushed on stack when a signal is delivered.
  190.  * This is used by the kernel to restore state following
  191.  * execution of the signal handler.  On some systems it is also made
  192.  * available to the handler to allow it to properly restore state if a
  193.  * non-standard exit is performed.  However, user programs should not
  194.  * rely on having access to this information.
  195.  */
  196. struct    sigcontext {
  197.     int    sc_onstack;        /* sigstack state to restore */
  198.     int    sc_mask;        /* signal mask to restore */
  199.     int    sc_sp;            /* sp to restore */
  200.     int    sc_fp;            /* fp to restore */
  201.     int    sc_ap;            /* ap to restore */
  202.     int    sc_pc;            /* pc to restore */
  203.     int    sc_ps;            /* psl to restore */
  204. };
  205. #endif
  206.  
  207. #define    BADSIG        (void (*)())-1
  208. #define    SIG_DFL        (void (*)())0
  209. #define    SIG_IGN        (void (*)())1
  210.  
  211. #ifdef KERNEL
  212. #define    SIG_CATCH    (void (*)())2
  213. #define    SIG_HOLD    (void (*)())3
  214. #endif
  215.  
  216. /*
  217.  * Macro for converting signal number to a mask suitable for
  218.  * sigblock().
  219.  */
  220. #define sigmask(m)    (1 << ((m)-1))
  221.  
  222. #endif /* _SIGNAL */
  223. @
  224.  
  225.  
  226. 1.13
  227. log
  228. @Added definition of struct sigaction.
  229. @
  230. text
  231. @d7 1
  232. a7 1
  233.  * $Header: /sprite/src/lib/include/RCS/signal.h,v 1.12 91/09/05 21:54:04 shirriff Exp Locker: rab $
  234. a132 12
  235.  
  236. /*
  237.  * If changes are made to sigset_t or struct sigaction, the same changes
  238.  * must be made in /usr/include/signal.h as well.
  239.  */
  240. typedef int sigset_t;
  241.  
  242. struct  sigaction {
  243.         void            (*sa_handler)();
  244.         sigset_t        sa_mask;
  245.         int             sa_flags;
  246. };
  247. @
  248.  
  249.  
  250. 1.12
  251. log
  252. @Added include of machSignal.h to get sigcontext declaration.
  253. @
  254. text
  255. @d7 1
  256. a7 1
  257.  * $Header: /sprite/src/lib/include/RCS/signal.h,v 1.11 91/05/30 13:22:03 shirriff Exp Locker: shirriff $
  258. d133 12
  259. @
  260.  
  261.  
  262. 1.11
  263. log
  264. @Removed machine-dependent declaration.
  265. @
  266. text
  267. @d7 1
  268. a7 1
  269.  * $Header: /sprite/src/lib/include/RCS/signal.h,v 1.10 90/12/18 18:39:43 kupfer Exp Locker: shirriff $
  270. d14 1
  271. @
  272.  
  273.  
  274. 1.10
  275. log
  276. @Add function prototypes for signal, sigblock, sigpause, and
  277. sigsetmask.
  278. @
  279. text
  280. @d7 1
  281. a7 1
  282.  * $Header$
  283. d93 1
  284. d95 5
  285. d116 1
  286. @
  287.  
  288.  
  289. 1.9
  290. log
  291. @Change comments for sigcontext to discourage user programmers from
  292. using it.
  293. @
  294. text
  295. @d7 1
  296. d13 2
  297. d61 10
  298. a70 1
  299. void    (*signal())();
  300. @
  301.  
  302.  
  303. 1.8
  304. log
  305. @Didn't quite finish previous change.
  306. @
  307. text
  308. @d84 4
  309. a87 3
  310.  * execution of the signal handler.  It is also made available
  311.  * to the handler to allow it to properly restore state if
  312.  * a non-standard exit is performed.
  313. @
  314.  
  315.  
  316. 1.7
  317. log
  318. @Changed signal handlers from int () to void ().
  319. @
  320. text
  321. @d98 3
  322. a100 3
  323. #define    BADSIG        (int (*)())-1
  324. #define    SIG_DFL        (int (*)())0
  325. #define    SIG_IGN        (int (*)())1
  326. d103 2
  327. a104 2
  328. #define    SIG_CATCH    (int (*)())2
  329. #define    SIG_HOLD    (int (*)())3
  330. @
  331.  
  332.  
  333. 1.6
  334. log
  335. @Fixed #endif's.
  336. @
  337. text
  338. @d58 1
  339. a58 1
  340. int    (*signal())();
  341. d65 1
  342. a65 1
  343.     int    (*sv_handler)();    /* signal handler */
  344. @
  345.  
  346.  
  347. 1.5
  348. log
  349. @Added Sprite-specific signals.
  350. @
  351. text
  352. @d10 1
  353. a11 1
  354.  
  355. d14 1
  356. a105 1
  357. #endif
  358. d113 1
  359. a113 1
  360. #endif _KERNEL
  361. @
  362.  
  363.  
  364. 1.4
  365. log
  366. @Eliminate code that isn't useful for sprite anyway.
  367. @
  368. text
  369. @d48 8
  370. @
  371.  
  372.  
  373. 1.3
  374. log
  375. @Add ifdefs so that file can't be processed twice.
  376. @
  377. text
  378. @a14 8
  379. #ifndef sprite
  380. #ifdef KERNEL
  381. #include "../machine/trap.h"    /* codes for SIGILL, SIGFPE */
  382. #else
  383. #include <machine/trap.h>    /* codes for SIGILL, SIGFPE */
  384. #endif
  385. #endif sprite
  386.  
  387. @
  388.  
  389.  
  390. 1.2
  391. log
  392. @Ignore machine/trap.h
  393. @
  394. text
  395. @d9 3
  396. d112 2
  397. @
  398.  
  399.  
  400. 1.1
  401. log
  402. @Initial revision
  403. @
  404. text
  405. @d12 1
  406. d18 1
  407. @
  408.